<?php if($search):?>
<h2>查询司机信息</h2>
<?php else:?>
<h2>修改司机信息</h2>
<?php endif?>
<?php echo CHtml::beginForm(array($search?'search':'admin'),'post');?>
	<div><input type="text" name="name" value="<?php echo !isset($_GET['name'])?'':$_GET['name'];?>"/><input type="submit"/></div>
<?php echo CHtml::endForm();?>
<table class="dataGrid">
  <thead>
  <tr>
    <th><?php echo $sort->link('name'); ?></th>
    <th><?php echo $sort->link('household_register'); ?></th>
    <th><?php echo $sort->link('sex'); ?></th>
    <th><?php echo $sort->link('birthday'); ?></th>
    <th><?php echo $sort->link('card_id'); ?></th>
    <th><?php echo $sort->link('car_type'); ?></th>
    <th><?php echo $sort->link('dl_approve_date'); ?></th>
    <th><?php echo $sort->link('di_valid_date'); ?></th>
    <th><?php echo $sort->link('dl_Annual_date'); ?></th>
    <th><?php echo $sort->link('home_tel'); ?></th>
    <th><?php echo $sort->link('entry_time'); ?></th>
    <th><?php echo $sort->link('mobile_no'); ?></th>
    <th><?php echo $sort->link('state'); ?></th>
    <th><?php echo $sort->link('create_time'); ?></th>
	<?php if(!$search):?><th>Actions</th><?php endif ?>
  </tr>  
  </thead>
  <tbody>
<?php foreach($models as $n=>$model): ?>
  <tr class="<?php echo $n%2?'even':'odd';?>">
    <?php 
    	$url=array('show','id'=>$model->id);//把所有参数包括页码、查询参数传入显示信息页面
    	$url+=$_GET;
    	$url['ret']=$search?'search':'admin';
    ?>
    <td><?php echo CHtml::link($model->name,$url); ?></td>
    <td><?php echo CHtml::encode($model->household_register); ?></td>
    <td><?php echo CHtml::encode($model->sex==0?'男':'女'); ?></td>
    <td><?php echo CHtml::encode($model->birthday); ?></td>
    <td><?php echo CHtml::encode($model->card_id); ?></td>
    <td><?php echo CHtml::encode($model->car_type); ?></td>
    <td><?php echo CHtml::encode($model->dl_approve_date); ?></td>
    <td><?php echo CHtml::encode($model->di_valid_date); ?></td>
    <td><?php echo CHtml::encode($model->dl_Annual_date); ?></td>
    <td><?php echo CHtml::encode($model->home_tel); ?></td>
    <td><?php echo CHtml::encode($model->entry_time); ?></td>
    <td><?php echo CHtml::encode($model->mobile_no); ?></td>
    <td><?php echo CHtml::encode($model->state==0?'正常':'删除'); ?></td>
    <td><?php echo CHtml::encode($model->create_time); ?></td>
    <?php if(!$search):?>
    <td>
      <?php echo CHtml::link('修改',array('update','id'=>$model->id)+$_GET); ?>
     <?php echo CHtml::link('删除',array('delete','id'=>$model->id)+$_GET,array('confirm'=>"确定要删除{$model->name}的信息吗？")); ?>
	</td>
	<?php endif ?>
  </tr>
<?php endforeach; ?>
  </tbody>
</table>
<br/>
<?php $this->widget('CLinkPager',array('pages'=>$pages)); ?>